package com.neutech.maplestory.entity;

import com.neutech.maplestory.client.MapleStoryClient;
import com.neutech.maplestory.util.ImageUtil;

import java.awt.*;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class ItemPackage extends AbstractMapleStoryObject{
    public List<Item> items = new CopyOnWriteArrayList<>();
    public Image img;
    public ItemPackage(){
        this.x = 1300;
        this.y = 350;

    }

    public ItemPackage(MapleStoryClient msc){
        this();
        this.msc = msc;
        this.img = ImageUtil.getImage("itemPackage");

}

    @Override
    public void draw(Graphics g) {
       if (live){
           g.drawImage(img,x,y,null);
           for (int i = 0; i <items.size() ; i++) {
               Item item = items.get(i);
              g.drawImage(item.img,x + (i * 30) + 25,y + 55,null);
              g.drawString(item.qty + "",x + (i * 30) + 15,y + 85);
           }
       }
    }
}
